package com.cssw.fyzb.core.dao.exchange;

import com.cssw.fyzb.core.model.dodb.User;
import com.cssw.fyzb.core.model.dodb.YExchangeFLog;
import org.springframework.stereotype.Repository;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * asa
 * 2020.12.21
 */
@Repository
public class YExchangeFLogDaoImpl implements YExchangeFLogDao{
    @Override
   public Long updateData(Long userId, BigDecimal y_coin, BigDecimal f_coin){
        YExchangeFLog yExchangeFLog =new YExchangeFLog();
        yExchangeFLog.setUserId(userId);
        yExchangeFLog.setYCoin(y_coin);
        yExchangeFLog.setFCoin(f_coin);
        Date now = new Date();
        yExchangeFLog.setCreateTime(now);
        yExchangeFLog.save();
        return  yExchangeFLog.getYfId();
   }
}
